import { Component, Input, OnInit, OnDestroy } from '@angular/core';
import {ActiveTitleService} from '../../services/active-title.service';
interface Address {
    province: string;
    city: string;
}

@Component({
    selector: 'app-sl-user',
    templateUrl: './app.usercomponent.html',
})
export class UserComponent implements OnInit, OnDestroy {
    @Input() cardTitle = '卡片标题';
    @Input() comTitle;
    currentUser = '111';
    name: string;
    address: Address;
    showSkills: boolean;
    skills: string[];

    constructor() {
      this.name = 'septen';
      this.address = {
        province: '广东',
        city: '珠海'
      };
      this.showSkills = true;
      this.skills = ['react', 'vue', 'Angular 6.x'];
    }
    More(e) {
      console.log('收到！over');
      return 1 + 1;
    }
    toggleSkills() {
      this.showSkills = !this.showSkills;
      return this.showSkills;
    }
    ngOnInit() {
      console.log(this.name);
    }
    ngOnDestroy() {
      console.log('销毁');
    }
}
